<template>
  <div class="category-container">
    <div class="category-list">
      <div class="category-item active">
        <span>主页</span>
      </div>
      <div class="category-item">
        <span>我的学习</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'CategoryNav'
}
</script>

<style scoped>
.category-container {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0;
}

.category-list {
  width: 75%;
  margin-left: 12%;
  margin-right: auto;
  display: flex;
  gap: 40px;
}

.category-item {
  font-size: 16px;
  color: #666;
  cursor: pointer;
  padding: 8px 0;
  position: relative;
}

.category-item.active {
  color: #6d28d2;
  font-weight: 500;
}

.category-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #6d28d2;
}

.category-item:hover {
  color: #6d28d2;
}
</style>